<template>
  <div class="h-full w-full flex flex-col gap-3 overflow-y-auto bg-#FAF9F9">
    <template v-if="orderList.length">
      <Item v-for="item in orderList" :key="item.id" :data="item" />
    </template>
    <div v-else class="h-full w-full flex items-center justify-center">
      <span class="text-3.5 text-#999">暂无数据</span>
    </div>
  </div>
</template>

<script lang='ts' setup>
import Item from './Item/index.vue'
import { getExchangeRecord } from '@/api/home'
import type { IOrderData } from '@/api/home/types'
import { useUserStoreWidthOut } from '@/store/modules/user'

const orderList = ref<IOrderData[]>([])
const userStore = useUserStoreWidthOut()
async function getData() {
  const res = await getExchangeRecord({
    phone: userStore.getUserInfo.phone,
    page: 1,
    size: 100,
  })
  orderList.value = res.data.records
}

getData()
</script>

<style lang='less' scoped>
</style>
